import { ResPage, Customer } from "@/api/interface/index";
import { PORT1 } from "@/api/config/servicePort";
import http from "@/api";

export const getCustomerList = async (params: Customer.ReqCustomerParams) => {
  const response = await http.post<ResPage<Customer.CustomerInfo>>(PORT1 + "/customer/appList", params);
  return response.data;
};
export const updateCustomer = async (params: Customer.ReqCustomerParams) => {
  const response = await http.post(PORT1 + "/customer/update", params);
  return response.data;
};

export const deleteCustomer = async (params: Customer.ReqCustomerParams) => {
  const response = await http.post(PORT1 + "/customer/delete", params);
  return response.data;
};

export const addCustomer = async (params: Customer.ReqCustomerParams) => {
  const response = await http.post(PORT1 + "/customer/add", params);
  return response.data;
};

export const ChangeCustomerStatus = async (params: Customer.ReqCustomerParams) => {
  const response = await http.post(PORT1 + "/customer/changeStatus", params);
  return response.data;
};

export const resetCustomerPassWord = async (params: Customer.ReqCustomerParams) => {
  const response = await http.post(PORT1 + "/customer/resetPassword", params);
  return response.data;
};

export const updatePassword = async (params: Customer.UpdatedPassword) => {
  const response = await http.post(PORT1 + "/customer/updatePassword", params);
  return response.data;
};
